package com.khyr.feign;

import com.khyr.vo.R;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @className: MedicinesFallbackFactory
 * @author: Zyl
 * @date: 2025/3/17 11:35
 * @Version: 1.0
 * @description:
 */

public class MedicinesFallbackFactory implements FallbackFactory<MedicinesFeign> {
    @Override
    public MedicinesFeign create(Throwable cause) {
        return new MedicinesFeign() {
            @Override
            public R reduce(String medicinesName, Integer medicinesStockNum) {
                return new R<>(500, "服务器故障", null);
            }
            @Override
            public R add(Long medicinesId, Integer medicinesStockNum) {
                return new R<>(500, "服务器故障", null);
            }
        };
    }
}
